package com.example.authsystem.dto;

/**
 * 认证相关的数据传输对象容器类
 * 包含登录、注册请求和响应的数据模型
 */
public class AuthDTO {
    
    /**
     * 登录请求数据传输对象
     * 用于接收用户登录时提交的用户名和密码
     */
    public static class LoginRequest {
        /**
         * 用户登录用户名
         */
        private String username;
        
        /**
         * 用户登录密码
         */
        private String password;
        
        // Getters and Setters
        public String getUsername() {
            return username;
        }
        
        public void setUsername(String username) {
            this.username = username;
        }
        
        public String getPassword() {
            return password;
        }
        
        public void setPassword(String password) {
            this.password = password;
        }
    }

    /**
     * 注册请求数据传输对象
     * 用于接收用户注册时提交的基本信息
     */
    public static class RegisterRequest {
        /**
         * 用户注册用户名
         */
        private String username;
        
        /**
         * 用户注册密码
         */
        private String password;
        
        /**
         * 用户注册邮箱
         */
        private String email;
        
        // Getters and Setters
        public String getUsername() {
            return username;
        }
        
        public void setUsername(String username) {
            this.username = username;
        }
        
        public String getPassword() {
            return password;
        }
        
        public void setPassword(String password) {
            this.password = password;
        }
        
        public String getEmail() {
            return email;
        }
        
        public void setEmail(String email) {
            this.email = email;
        }
    }

    /**
     * 认证响应数据传输对象
     * 用于返回认证成功后的令牌和用户信息
     */
    public static class AuthResponse {
        /**
         * JWT认证令牌
         */
        private String token;
        
        /**
         * 用户名
         */
        private String username;
        
        /**
         * 用户角色
         */
        private String role;
        
        // Getters and Setters
        public String getToken() {
            return token;
        }
        
        public void setToken(String token) {
            this.token = token;
        }
        
        public String getUsername() {
            return username;
        }
        
        public void setUsername(String username) {
            this.username = username;
        }
        
        public String getRole() {
            return role;
        }
        
        public void setRole(String role) {
            this.role = role;
        }
    }

    /**
     * 错误响应数据传输对象
     * 用于返回错误信息和状态码
     */
    public static class ErrorResponse {
        /**
         * 错误消息
         */
        private String message;
        
        /**
         * HTTP状态码
         */
        private int statusCode;
        
        // Getters and Setters
        public String getMessage() {
            return message;
        }
        
        public void setMessage(String message) {
            this.message = message;
        }
        
        public int getStatusCode() {
            return statusCode;
        }
        
        public void setStatusCode(int statusCode) {
            this.statusCode = statusCode;
        }
    }
}